<?php get_header(); ?>

<?php
if (have_posts()) {
   while (have_posts()) {
     the_post();
?>
<div class="post" id="post-<?php the_ID(); ?>">
     <div class="post-header">
	<h3 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<!--<h4 class="post-date">
		<span class="date1"><?php the_time('j') ?></span>
		<span class="date2"><?php the_time('F') ?></span>
		<span class="date3"><?php the_time('Y') ?></span>
	</h4>-->
     </div><!-- End div post-header -->
     <div class="post-content">
	<!--<img class="post-image" src="images/noel1_09_06-150x150.jpg" />-->
     <?php
	$currentPostId = get_the_ID();
	$readmore = array('La suite, la suite, la suite ...', 'Il m\'en faut encore !', 'Je veux en savoir plus !', 'La suite, je ne tiens plus ...', 'Le suspense est insoutenable, la suite !', 'Ne me dites pas que c\'est fini !?! Ah ouf, voilà la !', 'Pour les curieux, la suite est là ...', 'Suite de cet incroyable article');
	$post_content = get_the_content( $readmore[$currentPostId % sizeof($readmore)] );
	// Extract the first letter of the content to apply a specific CSS style
	if ($post_content[0] != '<') {  ?>
         <span class="dropcap"><?php echo $post_content[0] ?></span>
         <?php
		$post_content = substr($post_content, 1, strlen($post_content)-1);
	}
	$post_content = apply_filters('the_content', $post_content);
	$post_content = str_replace(']]>', ']]&gt;', $post_content);
	echo $post_content;
	//the_content( $readmore[$currentPostId % sizeof($readmore)] );
     ?>
     </div><!-- End div post-content -->
     <div class="post-info">
	Le <?php the_time('j F Y'); ?> &agrave; <?php the_time('H:i'); ?><br>
	<?php the_tags('Mots cl&eacute;s : ', ', ', ''); ?><br>
	Cat&eacute;gories : <?php the_category(', '); ?><br/>
	Ecrit par <b><?php the_author('login', display); ?></b> <?php edit_post_link('Editer',' &bull; ',''); ?> &bull; 
	<?php comments_popup_link('Aucun commentaire (Ajouter)', 'Commentaires [1] (Ajouter)', 'Commentaires [%] (Ajouter)'); ?><br/><br/>
	<?php if (function_exists('the_ratings')) { the_ratings(); } ?>
     </div><!-- End div post-info -->

	<?php if ( is_single() && function_exists('related_posts') ) : ?>
	<div class="relatedposts">
		<p><b>&laquo;&nbsp;Articles sur le même th&egrave;me&nbsp;&raquo;&nbsp;:</b></p>
		<?php related_posts(); ?>
		<p style="font-size:0.9em">Articles li&eacute;s via le plugin
		<a href="http://mitcho.com/code/yarpp/">Yet Another Related Posts Plugin</a>.</p>
	</div>
	<?php endif; ?>

	<?php $withcomments = true; ?>
	<?php comments_template(); ?>

</div><!-- End div post -->

<?php
  }
} else {
?>
	<div class="post">
		<div class="post-header">
			<h3 class="post-title">Page ou article introuvable</h3>
		</div>
		<div class="post-content">
			<p>&nbsp;</p>
			<p>&nbsp;</p>
			<?php _e("Désolé, aucun article ne correspond à votre recherche."); ?>
			<p>&nbsp;</p>
			<p>&nbsp;</p>
		</div>
	</div>
<?php } ?>

<?php get_footer(); ?>
